UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fQSvIJzmXNw7nEqJI1CZM19jPaHaLEOCMPlEIEaLtuc=' 
WHERE 
  key_id = '06acd04f39cad112a496fe7b5457da2b0a3deb023433f15856ed78c1f899d3aa' 
  AND (
    token = 'fQSvIJzmXNw7nEqJI1CZM19jPaHaLEOCMPlEIEaLtuc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039