UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WRmXqJ2GMZ5I2PomTKPuwV9LhpvW1lpcaCREfm+Ao+Q='
WHERE
key_id = 'c1c307c06fb11342ee606a622056dd48148c2c8149d7989bbb7bf336f6b26f76'
AND (
token = 'WRmXqJ2GMZ5I2PomTKPuwV9LhpvW1lpcaCREfm+Ao+Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)