UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2/gQ1WDi/L2/VaRN70AtpmTaKqeV2rujYca47URtrs0='
WHERE
key_id = 'c5f9849e158d585c1798788bd36f9274a1bb5a4bdfbb38aed3a2fa8f48ba90d2'
AND (
token = '2/gQ1WDi/L2/VaRN70AtpmTaKqeV2rujYca47URtrs0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)