UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xdRe9DSWNikElVcrlai7wbvZdB6B6Xxfa/fEssgA2XU=' 
WHERE 
  key_id = 'd2e28a749bd270839a572f6dbafdbe5b92c2b19cd411ccfe9a34fd00e5b57d26' 
  AND (
    token = 'xdRe9DSWNikElVcrlai7wbvZdB6B6Xxfa/fEssgA2XU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030