UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tOVrAJJBLblhv8+bWq7Bbfe0Z8In85BXXu3BaWE/0PM='
WHERE
key_id = '21278e0407cf79c0800ecda76e0bc725c18341e69095c34700bce8e81c8192ff'
AND (
token = 'tOVrAJJBLblhv8+bWq7Bbfe0Z8In85BXXu3BaWE/0PM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)