UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'skMDMkuTIQI0odwF4GpRYHjgsVDgqfyjW4zlb8dLXPM='
WHERE
key_id = 'c63c713dc295bff21490e9bd1a1bf2637208fecdd1502e549aa4c0aa50e4975d'
AND (
token = 'skMDMkuTIQI0odwF4GpRYHjgsVDgqfyjW4zlb8dLXPM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)