UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FI8VYGMddt5mIS1eOhO94u+lZXb8QrkUPLzKTiQa5z4='
WHERE
key_id = 'e8d54d1041999a6157ecf744aca1471690bd32619c7a2f17607e79615d45a3dc'
AND (
token = 'FI8VYGMddt5mIS1eOhO94u+lZXb8QrkUPLzKTiQa5z4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)