UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3OP/qjz8+I9NuFhq0YwXW/RpzdKtNtw5uDEfmE95EBk=' 
WHERE 
  key_id = '0886140bbb867590fea8565e16fdd329dede8f14f9f7ad0d337c7a9c1b086b09' 
  AND (
    token = '3OP/qjz8+I9NuFhq0YwXW/RpzdKtNtw5uDEfmE95EBk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046