UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nbe3ceqUD8JRyeJO+kVTBJrPqc2GIr/gGNQJvcaR4p0='
WHERE
key_id = 'b53aef58d63ff486a94b4a6fcbe231bf560caee3b4a6e261d8813c914450f655'
AND (
token = 'nbe3ceqUD8JRyeJO+kVTBJrPqc2GIr/gGNQJvcaR4p0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)