UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DShG/FL113p4ZEfyWUcodIN4qg7PCVxZJm36SZMSbL0='
WHERE
key_id = 'ed4009d5cd83b90237eec0a4c3f93f781eb04a7a9378a9226879116186543f58'
AND (
token = 'DShG/FL113p4ZEfyWUcodIN4qg7PCVxZJm36SZMSbL0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)