UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qRV0SDPkK+lWqY1JpDnx4LvA4BP2YM7LLGt2XiFShmQ=' 
WHERE 
  key_id = '2c95e188d992bbb1a9f3f8d53b411a2b6428a404deeb1983b35162d10246bef7' 
  AND (
    token = 'qRV0SDPkK+lWqY1JpDnx4LvA4BP2YM7LLGt2XiFShmQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043