UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jRDOEJoupVTdtkXoscZC9xtJCes/bE8eGFF26XO2KfE='
WHERE
key_id = '9d5d8c2a6e3a7081f22df3633c68a503797dc137274fd4811531e37a88458284'
AND (
token = 'jRDOEJoupVTdtkXoscZC9xtJCes/bE8eGFF26XO2KfE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)