UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2gm/oEyJlSiTKv1f8YSLt7tW2/LmSiFCzr87NpTOTOI='
WHERE
key_id = 'f54a3ca2470968ff761ce75c18c9f2e0959ef42b46fc868ac3abb63d0437f6f6'
AND (
token = '2gm/oEyJlSiTKv1f8YSLt7tW2/LmSiFCzr87NpTOTOI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)