UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5oVQIsUkgcNP5pl25a93+MbmM1v391Q6pBndaWueAn4=' 
WHERE 
  key_id = '823cd2bfb343ecc542aa2e70fa452903f314f3a5f2f1153e3eb54363e5a6df9b' 
  AND (
    token = '5oVQIsUkgcNP5pl25a93+MbmM1v391Q6pBndaWueAn4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034