UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+DGapEtoGRFWJjIFw6KUjc2ICD/lYcMkVY7iCaS/tMk=' 
WHERE 
  key_id = '04b81444a0f474f97f28f3570c17f5433c9974f7cb91dc0b644cdf20edf4d8b0' 
  AND (
    token = '+DGapEtoGRFWJjIFw6KUjc2ICD/lYcMkVY7iCaS/tMk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031