UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1tSef+38SfbuK0jQGznVUqOwRPRlqPpRUgi9k01lTUU='
WHERE
key_id = '90ae127c23e7133b1d0ecfeb1bfd1a8ba2a06e73f5c122e1f4b045bffd21e0ae'
AND (
token = '1tSef+38SfbuK0jQGznVUqOwRPRlqPpRUgi9k01lTUU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)