UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3WVy5dVMfPIK1gQD88ukqmJSzZTbjsNLdM3QKfm6LCI='
WHERE
key_id = '2750659cb7f5ee99e5ab0c20ff73099dee4773e4b533f3186e40b6135141d8b4'
AND (
token = '3WVy5dVMfPIK1gQD88ukqmJSzZTbjsNLdM3QKfm6LCI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)