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