UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'SxlnaqCPTfYCHrT9zkuJ34Ln2EfSdhczxXL5CXOWdmQ=' 
WHERE 
  key_id = 'a6cb64aac1ccc582ac6edc1e1e823ac06b1e75e55a6353c67c37977c1cc28e3b' 
  AND (
    token = 'SxlnaqCPTfYCHrT9zkuJ34Ln2EfSdhczxXL5CXOWdmQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033