UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fUgp+rNweJRnyRtG9rWlV/D/vSpSnmCGz60PYirEOwE='
WHERE
key_id = '15f8ab255ae759dac487722495acd57f421595e9ac77e0519b424362ca9d0844'
AND (
token = 'fUgp+rNweJRnyRtG9rWlV/D/vSpSnmCGz60PYirEOwE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)