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

Query time 0.00044