UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FMyCyY4zvv5o3MoQAXg9+j4e7iNS+b+GWSxQN1ohVW0='
WHERE
key_id = '6b8526fa579573595e9b7a8d35ae1993455baf04b86cef6cabc28d566baf237f'
AND (
token = 'FMyCyY4zvv5o3MoQAXg9+j4e7iNS+b+GWSxQN1ohVW0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)