UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vrps54UfGZy1dZSBMXXQrWY8mTlWa7lFGAp7I1DjwkA='
WHERE
key_id = '744ed6e61749c7664e8ad77a9dc1de281a4f3a6c4b9421cc5f6f789e12e6e566'
AND (
token = 'vrps54UfGZy1dZSBMXXQrWY8mTlWa7lFGAp7I1DjwkA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)