UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MXvNO4ZohCGhJOFY8L+DIdeoOgEgXrypH2pfmZJsRFE='
WHERE
key_id = 'e921eec0fcadb8c4eea9832165dded1de3f1270daf2feb00dcc6905e9bdecb0e'
AND (
token = 'MXvNO4ZohCGhJOFY8L+DIdeoOgEgXrypH2pfmZJsRFE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)