UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Bxt87ytpmHsokPFSeJQIg9130msbvtVssqgRaLHHKpg='
WHERE
key_id = '69a2ed0bc908ea07aa565ecc17b7c4d8f7eb396040e71abd11fd439d3e6c3c1f'
AND (
token = 'Bxt87ytpmHsokPFSeJQIg9130msbvtVssqgRaLHHKpg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)