UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6r9OVlSaw4Rz4zN9yWbfWJAxnpksaq7De6owbtGOzzw='
WHERE
key_id = 'e7d1632edb5f3c97b14e5880ec332906d2f7624c0c686890242fa97678acfe91'
AND (
token = '6r9OVlSaw4Rz4zN9yWbfWJAxnpksaq7De6owbtGOzzw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)