UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0N70SLvgt0TXjaKH5ERm0kFfYehWPTkwKaL1MEpS85Q=' 
WHERE 
  key_id = 'e7163d20ec728aec4c9015dc4f302469dc3cf2e67d3828dc79436454c0fbde10' 
  AND (
    token = '0N70SLvgt0TXjaKH5ERm0kFfYehWPTkwKaL1MEpS85Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042