UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'X7Edw+PMIsUj4xOyDWPBxi14pPbVpDOg5iz5qDx9v/c=' 
WHERE 
  key_id = 'ac753dfebc1ba0062c7da25646f1e33021f11b95b55b496a586b1b4ea9b07616' 
  AND (
    token = 'X7Edw+PMIsUj4xOyDWPBxi14pPbVpDOg5iz5qDx9v/c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047