UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'J6vRjU1o+FbEYG+okZNO26wnKOxGYZyX/xiMnxQ7HZg=' 
WHERE 
  key_id = 'eab1b6a7f4739c7f914e403ae544e2a3c4ec87cb0e1613102f229d214c1ede57' 
  AND (
    token = 'J6vRjU1o+FbEYG+okZNO26wnKOxGYZyX/xiMnxQ7HZg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039