UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8OBI7mbeHxsjJiM5VQEbeRmAHcC9wia48E+AZm8vZio='
WHERE
key_id = 'db4df660fa3b38aa36d080cdf64f4b3c47bb4eccaf50947c93a97ac144a2cd21'
AND (
token = '8OBI7mbeHxsjJiM5VQEbeRmAHcC9wia48E+AZm8vZio='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)