UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 's12QvK8a8gUHtBFk7oUj9iudX9lTYIIO44br2ELCqEU='
WHERE
key_id = 'f0e9a6cb75388a5e41cd0c295952c944dbd2d81393473107f1c31483406e1a7f'
AND (
token = 's12QvK8a8gUHtBFk7oUj9iudX9lTYIIO44br2ELCqEU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)