UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ak63RL2NR4c6Vpd1jCLGFYM4HEs8vV2ESUcmINQVlKQ='
WHERE
key_id = '681cc010a517ff20fe4315989b818cddfe4e5d53b4af45151266ce0ffa9ab3e9'
AND (
token = 'ak63RL2NR4c6Vpd1jCLGFYM4HEs8vV2ESUcmINQVlKQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)