UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'I2WGDqHnsew835WtplcwVnO5Fk4EqZ05gp17iVTaTaY='
WHERE
key_id = '0952f8e53ee6febd160c6f9fc4096abb0125b263b4aea23f84c0b1b023232b1b'
AND (
token = 'I2WGDqHnsew835WtplcwVnO5Fk4EqZ05gp17iVTaTaY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)