UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'f8/GQxpRCwVCc7YcOpbpEWs+ZPq9LdXyBnBGF6yr5cY=' 
WHERE 
  key_id = '11d3c2402566b52993bd10f3b06311a58462225c0a78f54ef19b9a4af99d3209' 
  AND (
    token = 'f8/GQxpRCwVCc7YcOpbpEWs+ZPq9LdXyBnBGF6yr5cY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027