UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tYZ/CuL5p3wChbsp87ovchA0wxDKV8NPmNk8qwZBu/o='
WHERE
key_id = 'c2d71dfd9f51ec07d5c7ab98f7cec34f1757fbff2717b8d27f57c93f0a9885db'
AND (
token = 'tYZ/CuL5p3wChbsp87ovchA0wxDKV8NPmNk8qwZBu/o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)